Skip to content

Fix #12320 FP knownConditionTrueFalse with if chain#8547

Merged
chrchr-github merged 2 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_12320
May 12, 2026
Merged

Fix #12320 FP knownConditionTrueFalse with if chain#8547
chrchr-github merged 2 commits into
cppcheck-opensource:mainfrom
chrchr-github:chr_12320

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

@chrchr-github chrchr-github marked this pull request as ready for review May 11, 2026 08:58
@firewave
Copy link
Copy Markdown
Collaborator

We should probably add an explicit ProgramMemory test. I would also be interested in more details why this differed between compilers.

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

std::unordered_map makes not guarantees about the order of the elements. And in this case, the content of the map is used to determine if an element should be erased. That logic might still have problems.

Copy link
Copy Markdown
Collaborator

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wonder about the ticket/PR title. The test code does not use strtok().

@chrchr-github chrchr-github changed the title Fix #12320 FP knownConditionTrueFalse with strtok() Fix #12320 FP knownConditionTrueFalse with if chain May 12, 2026
@chrchr-github chrchr-github merged commit 7c7ed58 into cppcheck-opensource:main May 12, 2026
70 checks passed
@chrchr-github chrchr-github deleted the chr_12320 branch May 12, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants